home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / EXT / F-J / FunKey0.4.cpt / FunKey 0.4 / FunKey Docs.c next >
Text File  |  1990-06-02  |  8KB  |  168 lines

  1. /*
  2.  
  3. FunKey 0.4
  4.  
  5. by Alex D. Chaffee
  6.     chaffee@reed.uucp
  7.     Compuserve: 71210,1117
  8.     Reed College Box 259, Portland, OR 97202
  9.     
  10. Copyright © 1990.  All Rights Reserved.  Permission is granted to
  11. distribute freely, as long as this document and copyright information
  12. remain intact and are distributed along with the program.
  13.  
  14. Portions Copyright © 1989 Symantec Corporation.  Thanks to Michael Kahl et 
  15. al. for THINK C.
  16.  
  17. Also thanks to Paul Mercer, Darin Adler, Paul Snively, and Ken McLeod for
  18. ShowInit, Jason "We don't need no stinking patches" Klivington, and Steve
  19. Riggins and all the CompuServe/Usenet gurus for invaluable support and
  20. assistance.
  21.  
  22. Introduction:
  23.  
  24. FunKey is a replacement for Carlos Weber's old (but excellent) Pop-Keys 
  25. INIT.  Like Pop-Keys, it allows you to pull up a popup menu from which 
  26. you can select  any installed FKEYs.  Unlike Pop-Keys, the menu is not 
  27. selected by moving to a part of the screen.  Instead, when you hold down 
  28. the familiar Command and Shift keys, FunKey changes the pointer to its 
  29. own "F" cursor.  The menu pops up when you click the mouse button.  FunKey 
  30. also overcomes some bugs and shortcomings of Pop-Keys.
  31.  
  32. Installation:
  33.  
  34.     FunKey is a standard INIT, complete with startup icon.  To install it,
  35.     simply drag it into the system folder and reboot.  If you hold down
  36.     the mouse button during startup, FunKey will not install.
  37.  
  38. Usage:
  39.  
  40.     Like the man said - hold down Command and Shift at any point after
  41.     startup, and you will see the Funky Cursor.  You can then select a
  42.     function key the normal way - by pressing a number from zero to nine -
  43.     or the Funky way - by holding down the mouse button.  A menu will
  44.     appear, containing the names and ID#s of all FKEYs in the system
  45.     folder, installed with Suitcase or the like, and in any open files.  
  46.     Selecting an FKEY from the menu will activate it, just as if you had 
  47.     pressed the associated key.  The FKEYs which are installed on the 
  48.     keyboard are denoted by command-key equivalents (although pressing 
  49.     these keys while the menu is up won't do anything).  FKEYs with no 
  50.     name are named "Untitled."
  51.     
  52.     In the "About Box" is a checkbox allowing you to select whether or
  53.     not you'd like to see the ID numbers in the menu.  Untitled FKEYs will
  54.     always show their numbers, so that you can tell them apart.  (It's
  55.     not a bug...)  The About Box also has a set of self-explanatory radio 
  56.     buttons entitled "Sort by Name" and "Sort by Number."  If you change
  57.     any of these settings, FunKey will try to remember them by creating
  58.     a file called "FunKey Prefs" in your System Folder.  Actually, it
  59.     will put it in a folder called "Preferences", creating said folder if
  60.     it's not already there.  These names are in STR resource #128, if
  61.     you'd like to change them.
  62.     
  63.     (The use of a Preferences folder to reduce system folder clutter is
  64.     supported by several other programs, and it's relatively easy to fix
  65.     some INITs to use it as well.  Look in the INIT's resource fork with
  66.     ResEdit for a STR or STR# whose contents are the name of the
  67.     preferences file.  Add ":Preferences:" to the beginning of this string.
  68.     For example, Boomerang 2.0's STR -4048 resource reads, "Boomerang
  69.     Prefs".  Change this to ":Preferences:Boomerang Prefs", move your
  70.     Boomerang Prefs file into the Preferences folder, and reboot.  If
  71.     it crashes, you can always change it back...)
  72.     
  73.     As of version 0.4, there will be a 1 second delay between the time
  74.     you press command-shift and the time the cursor shows up.  You can
  75.     still click the mouse during the lag time.
  76.     
  77. Known Bugs and Limitations:
  78.  
  79. •    FunKey doesn't work quite right under MultiFinder: if you click above
  80.     a window that's not in the current layer, the menu will work all
  81.     right, but before it comes up or after it goes away, MultiFinder will 
  82.     *sometimes* switch layers.  (Note that normally, the mouse clicks are 
  83.     invisible to the  current application -- but keystrokes are revceived
  84.     by the application, to accomodate the Cmd-Shift menu items of 
  85.     some applications.)
  86.     
  87.     Sometimes, immediately after switching layers in the above fashion, an
  88.     item in the menu will appear as a dotted line.  Selecting this line 
  89.     will do nothing but beep.  The complete menu will return the next time.
  90.  
  91. •    If you have a lot of FKEYs installed, it may take a second or two
  92.     for the menu to come up after you click the mouse.  As of version 0.2,
  93.     FunKey only rebuilds its internal list whenever it has to, so the
  94.     first pause should be the longest.  There may be a way to make it
  95.     faster, but it may be more trouble than it's worth... If you find that
  96.     it's unusable at its present speed, let me know and I'll be more 
  97.     motivated to fix it.
  98.  
  99. Wish List:
  100.  
  101. •    Make it a Control Panel Device, or at least add a better "Configure" 
  102.     item
  103. •    Allow for user-configurable "hot" keys (other than Command-Shift)
  104. •    Add a "hot rect" feature like Pop-Keys
  105. •    FKEY mover features, like Renumber, Rename, and Open File
  106. •    "Where Is" function - to show the file a given FKEY is from
  107. •    ...Suggestions?
  108.  
  109. Technical Info:
  110.  
  111. FunKey patches the low-memory global jGNEFilter to install its own
  112. GetNextEvent filtering routine.  This routine checks GetKeys to set the
  113. cursor, then if the event is a mouseDown, pops the menu.  FunKey also 
  114. patches SetCursor and InitCursor so that the Funky Cursor isn't changed 
  115. while Command and Shift are down.  To find out when it has to rebuild its
  116. list, it first checks to see if the resource map looks different, then
  117. checks all its handles to make sure they're valid.  Thus if you load or
  118. unload a new FKEY file with Suitcase or Juggler, or switch layers into
  119. an application with its own FKEYs, then the next time you use FunKey it'll
  120. rebuild its list.
  121.  
  122. A Request:
  123.     
  124.     I am not asking for any remuneration for FunKey, other than the
  125.     following:  if you like it, if you find a bug, if you have any
  126.     suggestions or gripes, or if you want to say "Hi," please let me know.  
  127.     I'm not in this for the money (at least not yet), only for the 
  128.     satisfaction of knowing that my (enjoyable) efforts have also been
  129.     enjoyed by others.
  130.  
  131. Version History:
  132.  
  133. 10/89    Prototype written
  134. 1/8/90    After finals and break, version 0.1 is ready to roll
  135. 1/28/90    Version 0.2
  136.         •    It's now a bit quicker - it only rebuilds its internal FKEY
  137.             list when something has changed.  (The remaining delay is
  138.             for the menu itself to be built.)  When it's doing this it
  139.             shows the watch cursor.
  140.         •    It builds the list right after startup too.  This time it
  141.             shows the Funky cursor.
  142.         •    You can no longer use FunKey from within its own About Box.
  143.             (Which means you'd better not do an exit-to-shell from the
  144.             About Box -- FunKey will never turn itself back on!)
  145.         •    Now uses a slightly optimized quicksort algorithm for a few
  146.             precious ticks of speed.
  147.         •    Preferences in About Box and Funky Prefs file (see above).
  148.         •    "Funky Down" sound (courtesy of James Brown)
  149.  
  150. 2/4/90    Version 0.3
  151.         •    About Box / prefs file crash fixed
  152.         •    Removed hooks for sound (sorry, James!)
  153.         •    Cooler About Box
  154.         
  155. 5/16/90    Version 0.4
  156.         •    Compatible with Kiss INIT
  157.         •    Now creates a Preferences folder if one doesn't exist
  158.         •    Never accidentally uses someone else's menu instead
  159.         •    Sets cursor to arrow when a normal cmd-shift-key is pressed
  160.             Note: this doesn't work in DAs.
  161.         •    Added Cursor Delay (1 sec.) so screen dump FKEYs work (FKEYs 
  162.             get called by the system before FunKey gets a chance to turn 
  163.             its cursor off).  You can still click up the menu even though 
  164.             the cursor isn't showing.
  165.         •    Added some error alerts (esp. "Not enough memory to load 
  166.             FKEY.")
  167. */
  168.